/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.registration.business.security.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author Luca
 */
@Entity
public class UsersEvent implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @ManyToOne(targetEntity = Users.class, optional = false, fetch=FetchType.LAZY)
    private Users users;
    @ManyToOne(targetEntity = Event.class, optional = false,fetch=FetchType.EAGER)
    private Event event;
    
    private Boolean creator;
    
    private Boolean accepted;
    
    private Boolean seen;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the users
     */
    public Users getUsers() {
        return users;
    }

    /**
     * @param users the users to set
     */
    public void setUsers(Users users) {
        this.users = users;
    }

    /**
     * @return the event
     */
    public Event getEvent() {
        return event;
    }

    /**
     * @param event the event to set
     */
    public void setEvent(Event event) {
        this.event = event;
    }

    /**
     * @return the creator
     */
    public Boolean getCreator() {
        return creator;
    }

    /**
     * @param creator the creator to set
     */
    public void setCreator(Boolean creator) {
        this.creator = creator;
    }

    /**
     * @return the accepted
     */
    public Boolean getAccepted() {
        return accepted;
    }

    /**
     * @param accepted the accepted to set
     */
    public void setAccepted(Boolean accepted) {
        this.accepted = accepted;
    }

    /**
     * @return the seen
     */
    public Boolean getSeen() {
        return seen;
    }

    /**
     * @param seen the seen to set
     */
    public void setSeen(Boolean seen) {
        this.seen = seen;
    }
    
    public UsersEvent(Event event, Users users, boolean creator){
            this.event=event;
            this.users=users;
            this.creator=creator;
        }
    public UsersEvent(){
        
    }
}
